import { reqFindUserAddressList ,reqOrderTradeList,reqPayStatus} from '@/api/trade/index'

const state = {
  userAddressList:[],
  orderInfo:{}
};
const mutations = {
  FINDUSERADDRESSLIST(state,userAddressList){
    state.userAddressList = userAddressList
  },
  ORDERINFO(state,orderInfo){
    state.orderInfo = orderInfo
  }
};
const actions = {
  // 查看用戶地址
  async findUserAddressList({commit}){
    let res = await reqFindUserAddressList()
    if(res.code == 200){
      commit('FINDUSERADDRESSLIST',res.data)
    }
  },  
  //  获取订单交易页信息
  async getOrderInfo({commit}){
    let res = await reqOrderTradeList()
    if(res?.code == 200){
      commit('ORDERINFO',res.data)
    }
  },
};
const getters = {

};
export default {
  state,
  mutations,
  actions,
  getters
}